package com.oyun.modules;

public class Test {
    public static void main(String[] args) {
        // 甲队队员
        String[] teamA = {"A", "B", "C"};
        // 乙队队员
        String[] teamB = {"X", "Y", "Z"};
        // 根据抽签结果确定对手
        String[] opponents = determineOpponents(teamA, teamB);
        // 输出结果
        System.out.println("甲队对手分别是：");
        for (int i = 0; i < teamA.length; i++) {
            System.out.println(teamA[i] + " 的对手是 " + opponents[i]);
        }
    }
    // 根据抽签结果确定甲队的对手
    public static String[] determineOpponents(String[] teamA, String[] teamB) {
        String[] opponents = new String[teamA.length];
        // 根据抽签结果确定对手
        // A 不和 X 比，C 不和 X 或 Z 比
        for (int i = 0; i < teamA.length; i++) {
            String playerA = teamA[i];
            if (playerA.equals("A")) {
                opponents[i] = "Y"; // A 的对手只能是 Y
            } else if (playerA.equals("C")) {
                opponents[i] = "Y"; // C 的对手只能是 Y
            } else {
                opponents[i] = "X"; // B 的对手只能是 X
            }
        }
        return opponents;
    }
}
